#ifndef IMPORTDCMFILETHREAD_H
#define IMPORTDCMFILETHREAD_H

#include <QThread>
#include <QMap>
struct StudyRecord;
class QFtp;
class QFile;

class ImportDcmFileThread : public QThread
{
    Q_OBJECT
public:
    explicit ImportDcmFileThread(QObject *parent = 0);
    ~ImportDcmFileThread();

    void run();
    void setStudyList(const QList<StudyRecord*> &studies) { studyList = studies; }

signals:
    void resultReady(StudyRecord *study);
    void fileTransferred();

public slots:
    void setAbort(bool yes) { abort = yes; }
    void onCmdFinished(int id, bool ok);
    void onProgress(qint64 cur, qint64 total);

private:
    void initFtp();

    volatile bool abort;
    QList<StudyRecord*> studyList;
    QMap<int, QFile*> snds;

    QFtp *ftp;
};

#endif // IMPORTDCMFILETHREAD_H
